package com.beigai.imessage.dao.mapper.ext;

import com.beigai.imessage.dao.mapper.UserImagePOMapper;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Result;
import org.apache.ibatis.annotations.Results;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.type.JdbcType;

/**
 * Created by xxl on 2017/5/18.
 */
@Mapper
public interface UserImagePOMapperExt extends UserImagePOMapper {
    @Select({
            "   SELECT " +
                    "  a.`real_file_name` " +
                    "FROM" +
                    "  user_image a " +
                    "WHERE a.`file_md5` = #{fileMD5,jdbcType=VARCHAR}" +
                    "LIMIT 1"
    })
    @Results({
            @Result(column = "real_file_name", property = "realFileName", jdbcType = JdbcType.VARCHAR)
    })
    String queryByMd5(String fileMD5);
}
